home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume7 / nethack3 / patch7g < prev    next >
Encoding:
Internet Message Format  |  1990-02-26  |  58.9 KB

  1. Path: uunet!lll-winken!brutus.cs.uiuc.edu!uakari!caesar.cs.montana.edu!milton!uw-beaver!zephyr.ens.tek.com!tekred!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v09i007:  NetHack3 -  display oriented dungeons & dragons (Ver. 3.0), Patch7g
  5. Message-ID: <5221@tekred.CNA.TEK.COM>
  6. Date: 24 Feb 90 00:33:47 GMT
  7. Sender: news@tekred.CNA.TEK.COM
  8. Lines: 2238
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted-by: Izchak Miller <izchak@linc.cis.upenn.edu>
  12. Posting-number: Volume 9, Issue 7
  13. Archive-name: NetHack3/Patch7g
  14. Patch-To: NetHack3: Volume 7, Issue 56-93
  15.  
  16.  
  17.  
  18. #! /bin/sh
  19. # This is a shell archive.  Remove anything before this line, then unpack
  20. # it by saving it into a file and typing "sh file".  To overwrite existing
  21. # files, type "sh file -c".  You can also feed this as standard input via
  22. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  23. # will see the following message at the end:
  24. #        "End of archive 7 (of 30)."
  25. # Contents:  patch7.03
  26. # Wrapped by billr@saab on Wed Feb 21 10:04:28 1990
  27. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  28. if test -f 'patch7.03' -a "${1}" != "-c" ; then 
  29.   echo shar: Renaming existing file \"'patch7.03'\" to \"'patch7.03.orig'\"
  30.   mv -f 'patch7.03' 'patch7.03.orig'
  31. fi
  32. echo shar: Extracting \"'patch7.03'\" \(56128 characters\)
  33. sed "s/^X//" >'patch7.03' <<'END_OF_FILE'
  34. X*** src/Old/dog.c    Mon Feb 19 17:59:10 1990
  35. X--- src/dog.c    Sun Feb 11 16:05:48 1990
  36. X***************
  37. X*** 1,4 ****
  38. X! /*    SCCS Id: @(#)dog.c    3.0    89/06/12
  39. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  40. X  /* NetHack may be freely redistributed.  See license for details. */
  41. X  
  42. X--- 1,4 ----
  43. X! /*    SCCS Id: @(#)dog.c    3.0    89/11/20
  44. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  45. X  /* NetHack may be freely redistributed.  See license for details. */
  46. X  
  47. X***************
  48. X*** 5,15 ****
  49. X--- 5,21 ----
  50. X  #include "hack.h"
  51. X  #include "edog.h"
  52. X  
  53. X+ #ifdef OVLB
  54. X+ 
  55. X  char dogname[63] = DUMMY;
  56. X  char catname[63] = DUMMY;
  57. X  
  58. X+ #endif /* OVLB */
  59. X+ 
  60. X  #define domestic(mtmp)    (mtmp->data->msound == MS_BARK || mtmp->data->msound == MS_MEW)
  61. X  
  62. X+ #ifdef OVLB
  63. X+ 
  64. X  void
  65. X  initedog(mtmp)
  66. X  register struct monst *mtmp;
  67. X***************
  68. X*** 59,64 ****
  69. X--- 65,71 ----
  70. X          return;
  71. X      }
  72. X      initedog(mtmp);
  73. X+     mtmp->msleep = 0;
  74. X      if (otmp && otmp->cursed) { /* cursed figurine */
  75. X          You("get a bad feeling about this.");
  76. X          mtmp->mtame = mtmp->mpeaceful = 0;
  77. X***************
  78. X*** 85,100 ****
  79. X      if(!mtmp) return((struct monst *) 0); /* dogs were genocided */
  80. X  
  81. X      if (petname[0]) {
  82. X!         register struct monst *mtmp2;
  83. X! 
  84. X!         mtmp->mnamelth = strlen(petname) + 1;
  85. X!         mtmp2 = newmonst(sizeof(struct edog) + mtmp->mnamelth);
  86. X!         *mtmp2 = *mtmp;
  87. X! 
  88. X!         replmon(mtmp, mtmp2);
  89. X!         mtmp = mtmp2;
  90. X!         Strcpy(NAME(mtmp), petname);
  91. X          petname[0] = '\0'; /* name first only; actually unnecessary */
  92. X      }
  93. X      initedog(mtmp);
  94. X      return(mtmp);
  95. X--- 92,101 ----
  96. X      if(!mtmp) return((struct monst *) 0); /* dogs were genocided */
  97. X  
  98. X      if (petname[0]) {
  99. X!         mtmp = christen_monst(mtmp, petname);
  100. X! #ifndef MACOS
  101. X          petname[0] = '\0'; /* name first only; actually unnecessary */
  102. X+ #endif
  103. X      }
  104. X      initedog(mtmp);
  105. X      return(mtmp);
  106. X***************
  107. X*** 102,109 ****
  108. X  
  109. X  /* attach the monsters that went down (or up) together with @ */
  110. X  struct monst *mydogs = 0;
  111. X! /* monsters that fell through a trapdoor or stepped on a tele-trap. */
  112. X! /* 'down' is now true only of trapdooor falling, not for tele-trap. */
  113. X  struct monst *fallen_down = 0;
  114. X                  
  115. X  void
  116. X--- 103,110 ----
  117. X  
  118. X  /* attach the monsters that went down (or up) together with @ */
  119. X  struct monst *mydogs = 0;
  120. X! /* monsters that fell through a trap door or stepped on a tele-trap. */
  121. X! /* 'down' is now true only of trap door falling, not for tele-trap. */
  122. X  struct monst *fallen_down = 0;
  123. X                  
  124. X  void
  125. X***************
  126. X*** 116,122 ****
  127. X          fmon = mtmp;
  128. X          mnexto(mtmp);
  129. X      }
  130. X! #ifdef LINT
  131. X      mtmp0 = (struct monst *)0;
  132. X  #endif
  133. X      for(mtmp = fallen_down; mtmp; mtmp = mtmp2) {
  134. X--- 117,123 ----
  135. X          fmon = mtmp;
  136. X          mnexto(mtmp);
  137. X      }
  138. X! #if defined(LINT) || defined(__GNULINT__)
  139. X      mtmp0 = (struct monst *)0;
  140. X  #endif
  141. X      for(mtmp = fallen_down; mtmp; mtmp = mtmp2) {
  142. X***************
  143. X*** 155,161 ****
  144. X             the amulet; if you don't have it, will chase you
  145. X             only if in range. -3. */
  146. X              (u.uhave_amulet && mtmp->iswiz))
  147. X!             && !mtmp->msleep && !mtmp->mfroz) {
  148. X  #ifdef WORM
  149. X          /* Bug "fix" for worm changing levels collapsing dungeon
  150. X           */
  151. X--- 156,162 ----
  152. X             the amulet; if you don't have it, will chase you
  153. X             only if in range. -3. */
  154. X              (u.uhave_amulet && mtmp->iswiz))
  155. X!             && !mtmp->msleep && mtmp->mcanmove) {
  156. X  #ifdef WORM
  157. X          /* Bug "fix" for worm changing levels collapsing dungeon
  158. X           */
  159. X***************
  160. X*** 216,221 ****
  161. X--- 217,225 ----
  162. X          /* so rloc() on next level doesn't affect MON_AT() state */
  163. X  }
  164. X  
  165. X+ #endif /* OVLB */
  166. X+ #ifdef OVL1
  167. X+ 
  168. X  /* return quality of food; the lower the better */
  169. X  /* fungi will eat even tainted food */
  170. X  int
  171. X***************
  172. X*** 244,254 ****
  173. X              return POISON;
  174. X              return (carni ? CADAVER : MANFOOD);
  175. X          case CORPSE:
  176. X!             if ((obj->age+50 <= moves && obj->corpsenm != PM_LIZARD
  177. X                          && mon->data->mlet != S_FUNGUS) ||
  178. X              (poisonous(&mons[obj->corpsenm]) &&
  179. X                          !resists_poison(mon->data)))
  180. X              return POISON;
  181. X              else return (carni ? CADAVER : MANFOOD);
  182. X          case CLOVE_OF_GARLIC:
  183. X              return (is_undead(mon->data) ? TABU :
  184. X--- 248,263 ----
  185. X              return POISON;
  186. X              return (carni ? CADAVER : MANFOOD);
  187. X          case CORPSE:
  188. X!             if ((obj->age+50 <= monstermoves
  189. X!                         && obj->corpsenm != PM_LIZARD
  190. X                          && mon->data->mlet != S_FUNGUS) ||
  191. X+             (acidic(&mons[obj->corpsenm]) &&
  192. X+                         !resists_acid(mon->data)) ||
  193. X              (poisonous(&mons[obj->corpsenm]) &&
  194. X                          !resists_poison(mon->data)))
  195. X              return POISON;
  196. X+             else if (mon->data->mlet == S_FUNGUS)
  197. X+             return (herbi ? CADAVER : MANFOOD);
  198. X              else return (carni ? CADAVER : MANFOOD);
  199. X          case CLOVE_OF_GARLIC:
  200. X              return (is_undead(mon->data) ? TABU :
  201. X***************
  202. X*** 277,282 ****
  203. X--- 286,294 ----
  204. X      }
  205. X  }
  206. X  
  207. X+ #endif /* OVL1 */
  208. X+ #ifdef OVL0
  209. X+ 
  210. X  /* return roomnumber or -1 */
  211. X  int
  212. X  inroom(x,y) xchar x,y; {
  213. X***************
  214. X*** 290,295 ****
  215. X--- 302,310 ----
  216. X      return(-1);    /* not in room or on door */
  217. X  }
  218. X  
  219. X+ #endif /* OVL0 */
  220. X+ #ifdef OVLB
  221. X+ 
  222. X  int
  223. X  tamedog(mtmp, obj)
  224. X  register struct monst *mtmp;
  225. X***************
  226. X*** 306,312 ****
  227. X      /* If we cannot tame him, at least he's no longer afraid. */
  228. X      mtmp->mflee = 0;
  229. X      mtmp->mfleetim = 0;
  230. X!     if(mtmp->mtame || mtmp->mfroz ||
  231. X  #ifdef MEDUSA
  232. X         mtmp->data == &mons[PM_MEDUSA] ||
  233. X  #endif
  234. X--- 321,327 ----
  235. X      /* If we cannot tame him, at least he's no longer afraid. */
  236. X      mtmp->mflee = 0;
  237. X      mtmp->mfleetim = 0;
  238. X!     if(mtmp->mtame || !mtmp->mcanmove ||
  239. X  #ifdef MEDUSA
  240. X         mtmp->data == &mons[PM_MEDUSA] ||
  241. X  #endif
  242. X***************
  243. X*** 334,336 ****
  244. X--- 349,353 ----
  245. X      replmon(mtmp,mtmp2);
  246. X      return(1);
  247. X  }
  248. X+ 
  249. X+ #endif /* OVLB */
  250. X*** src/Old/dogmove.c    Mon Feb 19 17:59:33 1990
  251. X--- src/dogmove.c    Mon Feb  5 18:09:09 1990
  252. X***************
  253. X*** 7,15 ****
  254. X  #include "mfndpos.h"
  255. X  #include "edog.h"
  256. X  
  257. X  static const char nofetch[] = { BALL_SYM, CHAIN_SYM, ROCK_SYM, 0 };
  258. X  
  259. X! static void
  260. X  dog_eat(mtmp, obj, otyp, x, y)
  261. X  register struct monst *mtmp;
  262. X  register struct obj * obj;
  263. X--- 7,23 ----
  264. X  #include "mfndpos.h"
  265. X  #include "edog.h"
  266. X  
  267. X+ #ifdef OVL0
  268. X+ 
  269. X  static const char nofetch[] = { BALL_SYM, CHAIN_SYM, ROCK_SYM, 0 };
  270. X  
  271. X! #endif /* OVL0 */
  272. X! 
  273. X! OSTATIC void FDECL(dog_eat, (struct monst *, struct obj *, XCHAR_P, int, int));
  274. X! 
  275. X! #ifdef OVLB
  276. X! 
  277. X! XSTATIC void
  278. X  dog_eat(mtmp, obj, otyp, x, y)
  279. X  register struct monst *mtmp;
  280. X  register struct obj * obj;
  281. X***************
  282. X*** 54,59 ****
  283. X--- 62,70 ----
  284. X      delobj(obj);
  285. X  }
  286. X  
  287. X+ #endif /* OVLB */
  288. X+ #ifdef OVL0
  289. X+ 
  290. X  /* return 0 (no move), 1 (move) or 2 (dead) */
  291. X  int
  292. X  dog_move(mtmp, after)
  293. X***************
  294. X*** 75,80 ****
  295. X--- 86,94 ----
  296. X  #define GDIST(x,y) (dist2(x,y,gx,gy))
  297. X  #define DDIST(x,y) (dist2(x,y,omx,omy))
  298. X  
  299. X+ #ifdef __GNULINT__
  300. X+     chi = -1;    /* gcc warning from 'goto newdogpos' */
  301. X+ #endif
  302. X      omx = mtmp->mx;
  303. X      omy = mtmp->my;
  304. X      whappr = (moves - edog->whistletime < 5);
  305. X***************
  306. X*** 134,139 ****
  307. X--- 148,154 ----
  308. X              goto newdogpos;
  309. X              }
  310. X              if(can_carry(mtmp, obj))
  311. X+             if(!obj->cursed)
  312. X              if(rn2(20) < edog->apport+3)
  313. X              if(rn2(udist) || !rn2((int) edog->apport)){
  314. X              if (cansee(omx, omy) && flags.verbose)
  315. X***************
  316. X*** 243,248 ****
  317. X--- 258,269 ----
  318. X      
  319. X      allowflags = ALLOW_M | ALLOW_TRAPS | ALLOW_SSM | ALLOW_SANCT;
  320. X      if (passes_walls(mtmp->data)) allowflags |= (ALLOW_ROCK|ALLOW_WALL);
  321. X+     if (throws_rocks(mtmp->data)) allowflags |= ALLOW_ROCK;
  322. X+     if (!nohands(mtmp->data) && !verysmall(mtmp->data)) {
  323. X+         allowflags |= OPENDOOR;
  324. X+         if (m_carrying(mtmp, SKELETON_KEY)) allowflags |= BUSTDOOR;
  325. X+     }
  326. X+     if (is_giant(mtmp->data)) allowflags |= BUSTDOOR;
  327. X      if (tunnels(mtmp->data) && !needspick(mtmp->data))
  328. X          allowflags |= ALLOW_DIG;
  329. X      cnt = mfndpos(mtmp, poss, info, allowflags);
  330. X***************
  331. X*** 258,263 ****
  332. X--- 279,285 ----
  333. X  #endif
  334. X          if(info[i] & ALLOW_M) {
  335. X              if(MON_AT(nx, ny)) {
  336. X+                 int stat;
  337. X                  register struct monst *mtmp2 = m_at(nx,ny);
  338. X  
  339. X                  if(mtmp2->m_lev >= mtmp->m_lev+2 ||
  340. X***************
  341. X*** 266,274 ****
  342. X                  continue;
  343. X                  if(after) return(0); /* hit only once each move */
  344. X  
  345. X!                 if(mattackm(mtmp, mtmp2) == 1 && rn2(4) &&
  346. X                    mtmp2->mlstmv != moves &&
  347. X                    mattackm(mtmp2, mtmp) == 2) return(2);
  348. X                  return(0);
  349. X              }
  350. X          }
  351. X--- 288,297 ----
  352. X                  continue;
  353. X                  if(after) return(0); /* hit only once each move */
  354. X  
  355. X!                 if((stat = mattackm(mtmp, mtmp2)) == 1 && rn2(4) &&
  356. X                    mtmp2->mlstmv != moves &&
  357. X                    mattackm(mtmp2, mtmp) == 2) return(2);
  358. X+                 if(stat == -1) return(2);
  359. X                  return(0);
  360. X              }
  361. X          }
  362. X***************
  363. X*** 377,379 ****
  364. X--- 400,404 ----
  365. X  #endif
  366. X      return(1);
  367. X  }
  368. X+ 
  369. X+ #endif /* OVL0 */
  370. X*** src/Old/dokick.c    Mon Feb 19 18:00:00 1990
  371. X--- src/dokick.c    Tue Feb  6 19:54:46 1990
  372. X***************
  373. X*** 7,12 ****
  374. X--- 7,14 ----
  375. X  
  376. X  #define martial()    ((pl_character[0] == 'S' || pl_character[0] == 'P'))
  377. X  
  378. X+ static struct rm *maploc;
  379. X+ 
  380. X  #ifdef KICK
  381. X  
  382. X  # ifdef WORM
  383. X***************
  384. X*** 13,18 ****
  385. X--- 15,26 ----
  386. X  extern boolean notonhead;
  387. X  # endif
  388. X  
  389. X+ static void FDECL(kickdmg, (struct monst *, BOOLEAN_P));
  390. X+ static void FDECL(kick_monster, (int, int));
  391. X+ static int FDECL(kick_object, (int, int));
  392. X+ 
  393. X+ static struct obj *obj = (struct obj *) 0;
  394. X+ 
  395. X  static void
  396. X  kickdmg(mon, clumsy)
  397. X  register struct monst *mon;
  398. X***************
  399. X*** 54,60 ****
  400. X          killed(mon);
  401. X          return;
  402. X      }
  403. X!     if(martial() && !bigmonst(mon->data) && !rn2(3) && !mon->mfroz) {
  404. X              /* see if the monster has a place to move into */
  405. X              mdx = mon->mx + u.dx;
  406. X              mdy = mon->my + u.dy;
  407. X--- 62,68 ----
  408. X          killed(mon);
  409. X          return;
  410. X      }
  411. X!     if(martial() && !bigmonst(mon->data) && !rn2(3) && mon->mcanmove) {
  412. X              /* see if the monster has a place to move into */
  413. X              mdx = mon->mx + u.dx;
  414. X              mdy = mon->my + u.dy;
  415. X***************
  416. X*** 70,76 ****
  417. X  
  418. X  /*    it is unchivalrous to attack the defenseless or from behind */
  419. X      if (pl_character[0] == 'K' && u.ualigntyp == U_LAWFUL && 
  420. X!         u.ualign > -10 && (mon->mfroz || mon->msleep || mon->mflee))
  421. X              adjalign(-1);
  422. X  
  423. X  }
  424. X--- 78,84 ----
  425. X  
  426. X  /*    it is unchivalrous to attack the defenseless or from behind */
  427. X      if (pl_character[0] == 'K' && u.ualigntyp == U_LAWFUL && 
  428. X!         u.ualign > -10 && (!mon->mcanmove || mon->msleep || mon->mflee))
  429. X              adjalign(-1);
  430. X  
  431. X  }
  432. X***************
  433. X*** 149,155 ****
  434. X      kludge("You kick %s.", mon_nam(mon));
  435. X      if(!rn2(clumsy ? 3 : 4) && (clumsy || !bigmonst(mon->data)) && 
  436. X         mon->mcansee && !mon->mtrapped && !thick_skinned(mon->data) && 
  437. X!        mon->data->mlet != S_EEL && haseyes(mon->data) && !mon->mfroz && 
  438. X         !mon->mstun && !mon->mconf && !mon->msleep &&
  439. X         mon->data->mmove >= 12) {
  440. X          if(!nohands(mon->data) && !rn2(martial() ? 5 : 3)) {
  441. X--- 157,163 ----
  442. X      kludge("You kick %s.", mon_nam(mon));
  443. X      if(!rn2(clumsy ? 3 : 4) && (clumsy || !bigmonst(mon->data)) && 
  444. X         mon->mcansee && !mon->mtrapped && !thick_skinned(mon->data) && 
  445. X!        mon->data->mlet != S_EEL && haseyes(mon->data) && mon->mcanmove && 
  446. X         !mon->mstun && !mon->mconf && !mon->msleep &&
  447. X         mon->data->mmove >= 12) {
  448. X          if(!nohands(mon->data) && !rn2(martial() ? 5 : 3)) {
  449. X***************
  450. X*** 236,245 ****
  451. X  bad_kick_throw_pos(x,y)
  452. X  xchar x,y;
  453. X  {
  454. X!     register struct rm *lvl = &(levl[x][y]);
  455. X! 
  456. X!     return(!ACCESSIBLE(lvl->typ) || lvl->typ == SDOOR ||
  457. X!         (IS_DOOR(lvl->typ) && (lvl->doormask & (D_CLOSED | D_LOCKED))) );
  458. X  }
  459. X  
  460. X  struct monst *
  461. X--- 244,250 ----
  462. X  bad_kick_throw_pos(x,y)
  463. X  xchar x,y;
  464. X  {
  465. X!     return(!accessible(x, y) || levl[x][y].typ == SDOOR);
  466. X  }
  467. X  
  468. X  struct monst *
  469. X***************
  470. X*** 286,292 ****
  471. X      int range, odx, ody, cnt = 0;
  472. X      register struct monst *mon;
  473. X      struct gold *gold;
  474. X!     register struct obj *otmp, *obj;
  475. X      boolean costly = FALSE;
  476. X  
  477. X      /* if a pile, the "top" object gets kicked */
  478. X--- 291,297 ----
  479. X      int range, odx, ody, cnt = 0;
  480. X      register struct monst *mon;
  481. X      struct gold *gold;
  482. X!     register struct obj *otmp;
  483. X      boolean costly = FALSE;
  484. X  
  485. X      /* if a pile, the "top" object gets kicked */
  486. X***************
  487. X*** 469,479 ****
  488. X  }
  489. X  #endif /* KICK */
  490. X  
  491. X  
  492. X  int
  493. X  dokick() {        /* try to kick the door down - noisy! */
  494. X          register int x, y;
  495. X-     register struct rm *maploc;
  496. X      register int avrg_attrib = (ACURR(A_STR)+ACURR(A_DEX)+ACURR(A_CON))/3;
  497. X  
  498. X  #ifdef POLYSELF
  499. X--- 474,521 ----
  500. X  }
  501. X  #endif /* KICK */
  502. X  
  503. X+ char *
  504. X+ kickstr() {
  505. X+     static char buf[BUFSIZ];
  506. X+ 
  507. X+ #ifdef KICK
  508. X+     if (obj) Sprintf(buf, "kicking %s", doname(obj));
  509. X+     else
  510. X+ #endif
  511. X+     if (IS_STWALL(maploc->typ)) Strcpy(buf, "kicking a wall");
  512. X+     else if (IS_ROCK(maploc->typ)) Strcpy(buf, "kicking a rock");
  513. X+ #ifdef THRONES
  514. X+     else if (IS_THRONE(maploc->typ)) Strcpy(buf, "kicking a throne");
  515. X+ #endif
  516. X+ #ifdef SINKS
  517. X+     else if (IS_SINK(maploc->typ)) Strcpy(buf, "kicking a sink");
  518. X+ #endif
  519. X+ #ifdef ALTARS
  520. X+     else if (IS_ALTAR(maploc->typ)) Strcpy(buf, "kicking an altar");
  521. X+ #endif
  522. X+ #ifdef STRONGHOLD
  523. X+     else if (IS_DRAWBRIDGE(maploc->typ))
  524. X+         Strcpy(buf, "kicking the drawbridge");
  525. X+ #endif
  526. X+     else {
  527. X+         switch (maploc->typ) {
  528. X+         case STAIRS:    
  529. X+             Strcpy(buf, "kicking the stairs");
  530. X+             break;
  531. X+ #ifdef STRONGHOLD
  532. X+         case LADDER:
  533. X+             Strcpy(buf, "kicking a ladder");
  534. X+             break;
  535. X+ #endif
  536. X+         }
  537. X+     }
  538. X+ 
  539. X+     return buf;
  540. X+ }
  541. X  
  542. X  int
  543. X  dokick() {        /* try to kick the door down - noisy! */
  544. X          register int x, y;
  545. X      register int avrg_attrib = (ACURR(A_STR)+ACURR(A_DEX)+ACURR(A_CON))/3;
  546. X  
  547. X  #ifdef POLYSELF
  548. X***************
  549. X*** 520,526 ****
  550. X          switch(rn2(3)) {
  551. X          case 0:  You("can't move your %s!", body_part(LEG));
  552. X               break;
  553. X!         case 1:  pline("%s burps loudly.", Monnam(u.ustuck)); break;
  554. X          default: Your("feeble kick has no effect."); break;
  555. X          }
  556. X          return(1);
  557. X--- 562,571 ----
  558. X          switch(rn2(3)) {
  559. X          case 0:  You("can't move your %s!", body_part(LEG));
  560. X               break;
  561. X!         case 1:  if (is_animal(u.ustuck->data)) {
  562. X!                  pline("%s burps loudly.", Monnam(u.ustuck)); 
  563. X!                        break; 
  564. X!                          }
  565. X          default: Your("feeble kick has no effect."); break;
  566. X          }
  567. X          return(1);
  568. X***************
  569. X*** 573,579 ****
  570. X  # ifdef THRONES
  571. X          if(IS_THRONE(maploc->typ)) {
  572. X              register int i;
  573. X!             if((u.uluck < 0 || maploc->doormask) && !rn2(3)) {
  574. X              pline("CRASH!  You destroy the throne.");
  575. X              maploc->typ = ROOM;
  576. X              maploc->doormask = 0; /* don't leave loose ends.. */
  577. X--- 618,624 ----
  578. X  # ifdef THRONES
  579. X          if(IS_THRONE(maploc->typ)) {
  580. X              register int i;
  581. X!             if((Luck < 0 || maploc->doormask) && !rn2(3)) {
  582. X              pline("CRASH!  You destroy the throne.");
  583. X              maploc->typ = ROOM;
  584. X              maploc->doormask = 0; /* don't leave loose ends.. */
  585. X***************
  586. X*** 580,589 ****
  587. X              mkgold((long)rnd(200), x, y);
  588. X              prl(x, y);
  589. X              return(1);
  590. X!             } else if(u.uluck && !rn2(3) && !maploc->looted) {
  591. X              You("kick loose some ornamental coins and gems!");
  592. X              mkgold((300L+(long)rn2(201)), x, y);
  593. X!             i = u.uluck + 1;
  594. X              if(i > 6) i = 6;
  595. X              while(i--) (void) mkobj_at(GEM_SYM, x, y);
  596. X              prl(x, y);
  597. X--- 625,634 ----
  598. X              mkgold((long)rnd(200), x, y);
  599. X              prl(x, y);
  600. X              return(1);
  601. X!             } else if(Luck > 0 && !rn2(3) && !maploc->looted) {
  602. X              You("kick loose some ornamental coins and gems!");
  603. X              mkgold((300L+(long)rn2(201)), x, y);
  604. X!             i = Luck + 1;
  605. X              if(i > 6) i = 6;
  606. X              while(i--) (void) mkobj_at(GEM_SYM, x, y);
  607. X              prl(x, y);
  608. X***************
  609. X*** 656,662 ****
  610. X  ouch:
  611. X              pline("Ouch!  That hurts!");
  612. X              if(!rn2(3)) set_wounded_legs(RIGHT_SIDE, 5 + rnd(5));
  613. X!             losehp(rnd(ACURR(A_CON) > 15 ? 3 : 5), "dumb move");
  614. X              return(1);
  615. X          }
  616. X  # ifdef STRONGHOLD
  617. X--- 701,708 ----
  618. X  ouch:
  619. X              pline("Ouch!  That hurts!");
  620. X              if(!rn2(3)) set_wounded_legs(RIGHT_SIDE, 5 + rnd(5));
  621. X!             losehp(rnd(ACURR(A_CON) > 15 ? 3 : 5), kickstr(),
  622. X!             KILLED_BY);
  623. X              return(1);
  624. X          }
  625. X  # ifdef STRONGHOLD
  626. X*** src/Old/dothrow.c    Mon Feb 19 18:00:36 1990
  627. X--- src/dothrow.c    Fri Feb  2 18:23:55 1990
  628. X***************
  629. X*** 6,12 ****
  630. X--- 6,14 ----
  631. X  
  632. X  #include "hack.h"
  633. X  
  634. X+ static void FDECL(hitfloor, (struct obj *));
  635. X  static void FDECL(gem_accept, (struct monst *, struct obj *));
  636. X+ static boolean NDECL(martial);
  637. X  static int FDECL(throw_gold, (struct obj *));
  638. X  static const char toss_objs[] = { '0', GOLD_SYM, '#', WEAPON_SYM, 0 };
  639. X  #ifdef WORM
  640. X***************
  641. X*** 100,106 ****
  642. X          potionhit(&youmonst, obj);
  643. X          else {
  644. X          if(uarmh) pline("Fortunately, you are wearing a helmet!");
  645. X!         losehp(uarmh ? 1 : rnd((int)(obj->owt)), "falling object");
  646. X          if (!breaks(obj, TRUE)) dropy(obj);
  647. X          }
  648. X        } else hitfloor(obj);
  649. X--- 102,109 ----
  650. X          potionhit(&youmonst, obj);
  651. X          else {
  652. X          if(uarmh) pline("Fortunately, you are wearing a helmet!");
  653. X!         losehp(uarmh ? 1 : rnd((int)(obj->owt)), "falling object",
  654. X!             KILLED_BY_AN);
  655. X          if (!breaks(obj, TRUE)) dropy(obj);
  656. X          }
  657. X        } else hitfloor(obj);
  658. X***************
  659. X*** 189,195 ****
  660. X                      (side == LEFT_SIDE) ? "left" : "right",
  661. X                      body_part(LEG));
  662. X                  set_wounded_legs(side, 500+rn2(1000));
  663. X!                 losehp(2, "thrown ball");
  664. X                  }
  665. X                  u.utrap = 0;
  666. X              }
  667. X--- 192,199 ----
  668. X                      (side == LEFT_SIDE) ? "left" : "right",
  669. X                      body_part(LEG));
  670. X                  set_wounded_legs(side, 500+rn2(1000));
  671. X!                 losehp(2, "leg damage from being pulled out of a bear trap",
  672. X!                     KILLED_BY);
  673. X                  }
  674. X                  u.utrap = 0;
  675. X              }
  676. X***************
  677. X*** 238,246 ****
  678. X          mon->msleep = 0;
  679. X          tmp += 2;
  680. X      }
  681. X!     if(mon->mfroz) {
  682. X          tmp += 4;
  683. X!         if(!rn2(10)) mon->mfroz = 0;
  684. X      }
  685. X      if (is_orc(mon->data) && pl_character[0]=='E') tmp++;
  686. X      if (u.uswallow && mon == u.ustuck) tmp += 1000; /* Guaranteed hit */
  687. X--- 242,253 ----
  688. X          mon->msleep = 0;
  689. X          tmp += 2;
  690. X      }
  691. X!     if(!mon->mcanmove) {
  692. X          tmp += 4;
  693. X!         if(!rn2(10)) {
  694. X!             mon->mcanmove = 1;
  695. X!             mon->mfrozen = 0;
  696. X!         }
  697. X      }
  698. X      if (is_orc(mon->data) && pl_character[0]=='E') tmp++;
  699. X      if (u.uswallow && mon == u.ustuck) tmp += 1000; /* Guaranteed hit */
  700. X***************
  701. X*** 310,317 ****
  702. X      } else {
  703. X          pline("The %s misses %s.", xname(obj),
  704. X              cansee(bhitpos.x,bhitpos.y) ? mon_nam(mon) : "it");
  705. X!         if(obj->olet == FOOD_SYM &&
  706. X!           (mon->data->mlet == S_DOG || mon->data->mlet == S_FELINE))
  707. X              if(tamedog(mon,obj)) return(1);
  708. X      }
  709. X      return(0);
  710. X--- 317,323 ----
  711. X      } else {
  712. X          pline("The %s misses %s.", xname(obj),
  713. X              cansee(bhitpos.x,bhitpos.y) ? mon_nam(mon) : "it");
  714. X!         if(obj->olet == FOOD_SYM && is_domestic(mon->data))
  715. X              if(tamedog(mon,obj)) return(1);
  716. X      }
  717. X      return(0);
  718. X***************
  719. X*** 422,429 ****
  720. X      }
  721. X  
  722. X      if(u.uswallow) {
  723. X!         pline("The gold disappears in the %s's entrails.", 
  724. X!                     mon_nam(u.ustuck));
  725. X          u.ustuck->mgold += zorks;
  726. X          return(1);
  727. X      }
  728. X--- 428,439 ----
  729. X      }
  730. X  
  731. X      if(u.uswallow) {
  732. X!         if (is_animal(u.ustuck->data))
  733. X!             pline("The gold disappears in the %s's entrails.", 
  734. X!                   mon_nam(u.ustuck));
  735. X!         else
  736. X!             pline("The gold disappears into %s.",
  737. X!                   mon_nam(u.ustuck));
  738. X          u.ustuck->mgold += zorks;
  739. X          return(1);
  740. X      }
  741. X*** src/Old/eat.c    Mon Feb 19 18:01:13 1990
  742. X--- src/eat.c    Mon Feb 19 10:18:37 1990
  743. X***************
  744. X*** 1,4 ****
  745. X! /*    SCCS Id: @(#)eat.c    3.0    89/11/15
  746. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  747. X  /* NetHack may be freely redistributed.  See license for details. */
  748. X  
  749. X--- 1,4 ----
  750. X! /*      SCCS Id: @(#)eat.c      3.0     89/11/21
  751. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  752. X  /* NetHack may be freely redistributed.  See license for details. */
  753. X  
  754. X***************
  755. X*** 13,24 ****
  756. X  # endif
  757. X  #endif
  758. X  
  759. X! static void FDECL(fpostfx, (struct obj *));
  760. X  static void FDECL(cpostfx, (int));
  761. X  
  762. X  char corpsename[60];
  763. X  char msgbuf[BUFSZ];
  764. X  
  765. X  /* hunger texts used on bottom line (each 8 chars long) */
  766. X  #define SATIATED    0
  767. X  #define NOT_HUNGRY    1
  768. X--- 13,61 ----
  769. X  # endif
  770. X  #endif
  771. X  
  772. X! static long FDECL(rounddiv, (long, long));
  773. X! #ifndef OVERLAY
  774. X! static int NDECL(Meatdone);
  775. X! #endif
  776. X! static void FDECL(choke, (struct obj *));
  777. X! static void NDECL(recalc_wt);
  778. X! static struct obj *FDECL(touchfood, (struct obj *));
  779. X! static void NDECL(do_reset_eat);
  780. X! #ifndef OVERLAY
  781. X! static int NDECL(eatfood);
  782. X! #endif
  783. X! static void FDECL(done_eating, (BOOLEAN_P));
  784. X! static void FDECL(cprefx, (int));
  785. X  static void FDECL(cpostfx, (int));
  786. X+ #ifndef OVERLAY
  787. X+ static int NDECL(opentin);
  788. X+ #endif
  789. X+ static void FDECL(start_tin, (struct obj *));
  790. X+ #ifdef POLYSELF
  791. X+ static int FDECL(rottenfood, (struct obj *));
  792. X+ #else
  793. X+ static int NDECL(rottenfood);
  794. X+ #endif
  795. X+ static int FDECL(eatcorpse, (struct obj *));
  796. X+ static void FDECL(start_eating, (struct obj *));
  797. X+ static void FDECL(fprefx, (struct obj *));
  798. X+ #ifdef POLYSELF
  799. X+ static void NDECL(eatspecial);
  800. X+ static const char * FDECL(foodword, (struct obj *));
  801. X+ #endif
  802. X+ static void FDECL(fpostfx, (struct obj *));
  803. X+ static int NDECL(bite);
  804. X+ #ifndef OVERLAY
  805. X+ static int NDECL(unfaint);
  806. X+ #endif
  807. X+ 
  808. X+ #ifdef OVLB
  809. X  
  810. X  char corpsename[60];
  811. X  char msgbuf[BUFSZ];
  812. X  
  813. X+ #endif /* OVLB */
  814. X+ 
  815. X  /* hunger texts used on bottom line (each 8 chars long) */
  816. X  #define SATIATED    0
  817. X  #define NOT_HUNGRY    1
  818. X***************
  819. X*** 28,33 ****
  820. X--- 65,72 ----
  821. X  #define FAINTED        5
  822. X  #define STARVED        6
  823. X  
  824. X+ #ifdef OVLB
  825. X+ 
  826. X  const char *hu_stat[] = {
  827. X      "Satiated",
  828. X      "        ",
  829. X***************
  830. X*** 39,44 ****
  831. X--- 78,106 ----
  832. X  };
  833. X  
  834. X  static const char comestibles[] = { FOOD_SYM, 0 };
  835. X+ #ifdef POLYSELF
  836. X+ static const char everything[] = { GOLD_SYM, /* must come first */
  837. X+     WEAPON_SYM, ARMOR_SYM, POTION_SYM, SCROLL_SYM, WAND_SYM,
  838. X+ #ifdef SPELLS
  839. X+     SPBOOK_SYM,
  840. X+ #endif
  841. X+     RING_SYM, WAND_SYM, AMULET_SYM, FOOD_SYM, TOOL_SYM, GEM_SYM,
  842. X+     ROCK_SYM, BALL_SYM, CHAIN_SYM, 0 };
  843. X+ 
  844. X+ boolean
  845. X+ is_edible(obj)
  846. X+ register struct obj *obj;
  847. X+ {
  848. X+     if (metallivorous(uasmon) && (obj->olet == GOLD_SYM ||
  849. X+             (objects[obj->otyp].oc_material > WOOD &&
  850. X+             objects[obj->otyp].oc_material < MINERAL)))
  851. X+         return TRUE;
  852. X+     if (u.umonnum == PM_GELATINOUS_CUBE &&
  853. X+             objects[obj->otyp].oc_material <= WOOD)
  854. X+         return TRUE;
  855. X+     return !!index(comestibles, obj->olet);
  856. X+ }
  857. X+ #endif
  858. X  
  859. X  /* calculate x/y, rounding as appropriate */
  860. X  
  861. X***************
  862. X*** 70,76 ****
  863. X      u.uhs = NOT_HUNGRY;
  864. X  }
  865. X  
  866. X! const struct { char *txt; int nut; } tintxts[] = {
  867. X      "deep fried",    60,
  868. X      "pickled",    40,
  869. X      "soup made from", 20,
  870. X--- 132,138 ----
  871. X      u.uhs = NOT_HUNGRY;
  872. X  }
  873. X  
  874. X! const struct { const char *txt; int nut; } tintxts[] = {
  875. X      "deep fried",    60,
  876. X      "pickled",    40,
  877. X      "soup made from", 20,
  878. X***************
  879. X*** 137,147 ****
  880. X          morehungry(1000);    /* you just got *very* sick! */
  881. X          vomit();
  882. X      } else {
  883. X          if(food) {
  884. X!             killer = singular(food, xname);
  885. X          } else
  886. X              killer = "exuberant appetite";
  887. X!         You("choke over your food.");
  888. X          You("die...");
  889. X          done(CHOKING);
  890. X      }
  891. X--- 199,221 ----
  892. X          morehungry(1000);    /* you just got *very* sick! */
  893. X          vomit();
  894. X      } else {
  895. X+         killer_format = KILLED_BY_AN;
  896. X          if(food) {
  897. X! #ifdef POLYSELF
  898. X!             if (food->olet == GOLD_SYM) {
  899. X!                 killer_format = KILLED_BY;
  900. X!                 killer = "eating too rich a meal";
  901. X!             } else
  902. X! #endif
  903. X!                 killer = singular(food, xname);
  904. X          } else
  905. X              killer = "exuberant appetite";
  906. X!         if (!food) You("choke over it.");
  907. X! #ifdef POLYSELF
  908. X!         else You("choke over your %s.", foodword(food));
  909. X! #else
  910. X!         else You("choke over your food.");
  911. X! #endif
  912. X          You("die...");
  913. X          done(CHOKING);
  914. X      }
  915. X***************
  916. X*** 203,208 ****
  917. X--- 277,294 ----
  918. X      return(otmp);
  919. X  }
  920. X  
  921. X+ /* When food decays, in the middle of your meal, we don't want to dereference
  922. X+  * any dangling pointers, so set it to null (which should still trigger
  923. X+  * do_reset_eat() at the beginning of eatfood()) and check for null pointers
  924. X+  * in do_reset_eat().
  925. X+  */
  926. X+ void
  927. X+ food_disappears(obj)
  928. X+ register struct obj *obj;
  929. X+ {
  930. X+     if (obj == victual.piece) victual.piece = (struct obj *)0;
  931. X+ }
  932. X+ 
  933. X  static void
  934. X  do_reset_eat() {
  935. X  
  936. X***************
  937. X*** 209,218 ****
  938. X  #ifdef DEBUG
  939. X      debug("do_reset_eat...");
  940. X  #endif
  941. X!     victual.piece = touchfood(victual.piece);
  942. X!     recalc_wt();
  943. X!     victual.fullwarn = victual.eating = victual.doreset = 
  944. X!         victual.canchoke = FALSE;
  945. X      stop_occupation();
  946. X  }
  947. X  
  948. X--- 295,310 ----
  949. X  #ifdef DEBUG
  950. X      debug("do_reset_eat...");
  951. X  #endif
  952. X!     if (victual.piece) {
  953. X!         victual.piece = touchfood(victual.piece);
  954. X!         recalc_wt();
  955. X!     }
  956. X!     victual.fullwarn = victual.eating = victual.doreset = FALSE;
  957. X!     /* Do not set canchoke to FALSE; if we continue eating the same object
  958. X!      * we need to know if canchoke was set when they started eating it the
  959. X!      * previous time.  And if we don't continue eating the same object
  960. X!      * canchoke always gets recalculated anyway.
  961. X!      */
  962. X      stop_occupation();
  963. X  }
  964. X  
  965. X***************
  966. X*** 227,284 ****
  967. X          return(0);
  968. X      }
  969. X      if(!victual.eating) return(0);
  970. X-     if(victual.usedtime++ < victual.reqtime) {
  971. X-     /* You can only choke if you were satiated before you started
  972. X-      * eating.
  973. X-      */
  974. X-         if(victual.canchoke && u.uhunger >= 2000) {
  975. X-         choke(victual.piece);
  976. X-         do_reset_eat(); /* if they were lifesaved, stop eating */
  977. X-         return 0;
  978. X-         }
  979. X- 
  980. X-         if(victual.nmod < 0)
  981. X-         lesshungry(-victual.nmod);
  982. X-         else if(victual.nmod > 0 && (victual.usedtime % victual.nmod))
  983. X-         lesshungry(1);
  984. X  
  985. X!         if(victual.doreset) do_reset_eat();
  986. X!         else {
  987. X!         /* We have to calculate this every move--sometimes the thing
  988. X!          * which interrupts eating also needs to know the state of your
  989. X!          * food, so it's no good to recalculate the state of your food
  990. X!          * only after you stopped eating.  Currently, the only meal-
  991. X!          * interruptor which needs to know it is troll revivication,
  992. X!          * and it only needs to know oeaten and the weight.
  993. X!          */
  994. X!         if (victual.nmod < 0)
  995. X!             victual.piece->oeaten -= -victual.nmod;
  996. X!         else if (victual.nmod > 0 && (victual.usedtime % victual.nmod))
  997. X!             victual.piece->oeaten--;
  998. X!         recalc_wt();
  999. X!         }
  1000. X!         return 1;    /* still busy */
  1001. X      } else {    /* done */
  1002. X  #ifndef NO_SIGNAL
  1003. X!         victual.piece->in_use = TRUE;
  1004. X  #endif
  1005. X!         if (nomovemsg) {
  1006. X!         pline(nomovemsg);
  1007. X          nomovemsg = 0;
  1008. X!         } else You("finish eating the %s.", singular(victual.piece, xname));
  1009. X  
  1010. X!         if(victual.piece->otyp == CORPSE)
  1011. X          cpostfx(victual.piece->corpsenm);
  1012. X!         else
  1013. X          fpostfx(victual.piece);
  1014. X  
  1015. X!         if (carried(victual.piece)) useup(victual.piece);
  1016. X!         else useupf(victual.piece);
  1017. X!         victual.piece = (struct obj *) 0;
  1018. X!         victual.fullwarn = victual.eating = victual.doreset = 
  1019. X!         victual.canchoke = FALSE;
  1020. X!         return(0);
  1021. X!     }
  1022. X  }
  1023. X  
  1024. X  static void
  1025. X--- 319,356 ----
  1026. X          return(0);
  1027. X      }
  1028. X      if(!victual.eating) return(0);
  1029. X  
  1030. X!     if(++victual.usedtime < victual.reqtime) {
  1031. X!         if(bite()) return(0);
  1032. X!         return(1);    /* still busy */
  1033. X      } else {    /* done */
  1034. X+         done_eating(TRUE);
  1035. X+         return(0);
  1036. X+     }
  1037. X+ }
  1038. X+ 
  1039. X+ static void
  1040. X+ done_eating(message)
  1041. X+ boolean message;
  1042. X+ {
  1043. X  #ifndef NO_SIGNAL
  1044. X!     victual.piece->in_use = TRUE;
  1045. X  #endif
  1046. X!     if (nomovemsg) {
  1047. X!         if (message) pline(nomovemsg);
  1048. X          nomovemsg = 0;
  1049. X!     } else if (message)
  1050. X!         You("finish eating the %s.", singular(victual.piece, xname));
  1051. X  
  1052. X!     if(victual.piece->otyp == CORPSE)
  1053. X          cpostfx(victual.piece->corpsenm);
  1054. X!     else
  1055. X          fpostfx(victual.piece);
  1056. X  
  1057. X!     if (carried(victual.piece)) useup(victual.piece);
  1058. X!     else useupf(victual.piece);
  1059. X!     victual.piece = (struct obj *) 0;
  1060. X!     victual.fullwarn = victual.eating = victual.doreset = FALSE;
  1061. X  }
  1062. X  
  1063. X  static void
  1064. X***************
  1065. X*** 286,292 ****
  1066. X  register int pm;
  1067. X  {
  1068. X      if ((pl_character[0]=='E') ? is_elf(&mons[pm]) : is_human(&mons[pm])) {
  1069. X!         You("cannibal!    You will regret this!");
  1070. X          Aggravate_monster |= INTRINSIC;
  1071. X      }
  1072. X  
  1073. X--- 358,364 ----
  1074. X  register int pm;
  1075. X  {
  1076. X      if ((pl_character[0]=='E') ? is_elf(&mons[pm]) : is_human(&mons[pm])) {
  1077. X!         You("cannibal!  You will regret this!");
  1078. X          Aggravate_monster |= INTRINSIC;
  1079. X      }
  1080. X  
  1081. X***************
  1082. X*** 304,318 ****
  1083. X          case PM_MEDUSA:
  1084. X  #endif
  1085. X  #ifdef POLYSELF
  1086. X!         if(!resists_ston(uasmon)) {
  1087. X  #endif
  1088. X!             killer = (char *) alloc(40);
  1089. X              You("turn to stone.");
  1090. X!             Sprintf(killer, "%s meat", mons[pm].mname);
  1091. X              done(STONING);
  1092. X  #ifdef POLYSELF
  1093. X-         }
  1094. X-         break;
  1095. X          case PM_LIZARD:
  1096. X          /* Relief from cockatrices -dgk */
  1097. X          if (Stoned) {
  1098. X--- 376,393 ----
  1099. X          case PM_MEDUSA:
  1100. X  #endif
  1101. X  #ifdef POLYSELF
  1102. X!         if(!resists_ston(uasmon))
  1103. X  #endif
  1104. X!             {
  1105. X!             char *cruft;    /* killer is const char * */
  1106. X!             killer_format = KILLED_BY;
  1107. X!             killer = cruft = (char *) alloc(40);
  1108. X              You("turn to stone.");
  1109. X!             Sprintf(cruft, "%s meat", mons[pm].mname);
  1110. X              done(STONING);
  1111. X+             }
  1112. X+             break;
  1113. X  #ifdef POLYSELF
  1114. X          case PM_LIZARD:
  1115. X          /* Relief from cockatrices -dgk */
  1116. X          if (Stoned) {
  1117. X***************
  1118. X*** 321,328 ****
  1119. X          }
  1120. X          break;
  1121. X          default:
  1122. X! 
  1123. X!         if(dmgtype(&mons[pm], AD_ACID) && Stoned) {
  1124. X              pline("What a pity - you just destroyed a future piece of art!");
  1125. X              Stoned = 0;
  1126. X          }
  1127. X--- 396,402 ----
  1128. X          }
  1129. X          break;
  1130. X          default:
  1131. X!         if(acidic(&mons[pm]) && Stoned) {
  1132. X              pline("What a pity - you just destroyed a future piece of art!");
  1133. X              Stoned = 0;
  1134. X          }
  1135. X***************
  1136. X*** 416,427 ****
  1137. X          if (HStun > 2)  make_stunned(2L,FALSE);
  1138. X          if (HConfusion > 2)  make_confused(2L,FALSE);
  1139. X          break;
  1140. X- #ifdef POLYSELF
  1141. X          case PM_CHAMELEON:
  1142. X          You("feel a change coming over you.");
  1143. X          polyself();
  1144. X!         break;
  1145. X  #endif
  1146. X          default: {
  1147. X          register struct permonst *ptr = &mons[pm];
  1148. X          if(dmgtype(ptr, AD_STUN) || ptr==&mons[PM_VIOLET_FUNGUS]) {
  1149. X--- 490,503 ----
  1150. X          if (HStun > 2)  make_stunned(2L,FALSE);
  1151. X          if (HConfusion > 2)  make_confused(2L,FALSE);
  1152. X          break;
  1153. X          case PM_CHAMELEON:
  1154. X          You("feel a change coming over you.");
  1155. X+ #ifdef POLYSELF
  1156. X          polyself();
  1157. X! #else
  1158. X!         newman();
  1159. X  #endif
  1160. X+         break;
  1161. X          default: {
  1162. X          register struct permonst *ptr = &mons[pm];
  1163. X          if(dmgtype(ptr, AD_STUN) || ptr==&mons[PM_VIOLET_FUNGUS]) {
  1164. X***************
  1165. X*** 428,433 ****
  1166. X--- 504,512 ----
  1167. X              pline ("Oh wow!  Great stuff!");
  1168. X              make_hallucinated(Hallucination + 200,FALSE);
  1169. X          }
  1170. X+         /* prevent polymorph abuse by killing/eating your offspring */
  1171. X+         if(ptr >= &mons[PM_BABY_GRAY_DRAGON] &&
  1172. X+            ptr <= &mons[PM_BABY_YELLOW_DRAGON]) return;
  1173. X          if(is_giant(ptr)) gainstr((struct obj *)0, 0);
  1174. X  
  1175. X          if(can_teleport(ptr) && ptr->mlevel > rn2(10)) {
  1176. X***************
  1177. X*** 435,456 ****
  1178. X              You("feel very jumpy.");
  1179. X              HTeleportation |= INTRINSIC;
  1180. X              }
  1181. X!         } else if(control_teleport(ptr) && ptr->mlevel > rn2(20)) {
  1182. X              if (!(HTeleport_control & INTRINSIC)) {
  1183. X              You("feel in control of yourself.");
  1184. X              HTeleport_control |= INTRINSIC;
  1185. X              }
  1186. X!         } else if(resists_fire(ptr) && ptr->mlevel > rn2(20)) {
  1187. X              if (!(HFire_resistance & INTRINSIC)) {
  1188. X              You("feel a momentary chill.");
  1189. X              HFire_resistance |= INTRINSIC;
  1190. X              }
  1191. X!         } else if(resists_cold(ptr) && ptr->mlevel > rn2(20)) {
  1192. X              if (!(HCold_resistance & INTRINSIC)) {
  1193. X              You("feel full of hot air.");
  1194. X              HCold_resistance |= INTRINSIC;
  1195. X              }
  1196. X!         } else if((ptr->mflags1 & M1_POIS_RES) && ptr->mlevel>rn2(20)) {
  1197. X          /* Monsters with only M1_POIS are poison resistant themselves,
  1198. X           * but do not confer resistance when eaten
  1199. X           */
  1200. X--- 514,536 ----
  1201. X              You("feel very jumpy.");
  1202. X              HTeleportation |= INTRINSIC;
  1203. X              }
  1204. X!         } else if(control_teleport(ptr) && ptr->mlevel > rn2(15)) {
  1205. X              if (!(HTeleport_control & INTRINSIC)) {
  1206. X              You("feel in control of yourself.");
  1207. X              HTeleport_control |= INTRINSIC;
  1208. X              }
  1209. X!         } else if(resists_fire(ptr) && ptr->mlevel > rn2(15)) {
  1210. X              if (!(HFire_resistance & INTRINSIC)) {
  1211. X              You("feel a momentary chill.");
  1212. X              HFire_resistance |= INTRINSIC;
  1213. X              }
  1214. X!         } else if(resists_cold(ptr) && ptr->mlevel > rn2(15)) {
  1215. X              if (!(HCold_resistance & INTRINSIC)) {
  1216. X              You("feel full of hot air.");
  1217. X              HCold_resistance |= INTRINSIC;
  1218. X              }
  1219. X!         } else if(((ptr->mflags1 & M1_POIS_RES) && ptr->mlevel>rn2(15))
  1220. X!            || ((pm == PM_KILLER_BEE || pm == PM_SCORPION) && !rn2(4))) {
  1221. X          /* Monsters with only M1_POIS are poison resistant themselves,
  1222. X           * but do not confer resistance when eaten
  1223. X           */
  1224. X***************
  1225. X*** 458,469 ****
  1226. X              You("feel healthy.");
  1227. X              HPoison_resistance |= INTRINSIC;
  1228. X              }
  1229. X!         } else if(resists_elec(ptr) && ptr->mlevel > rn2(20)) {
  1230. X              if (!(HShock_resistance & INTRINSIC)) {
  1231. X              Your("health currently feels amplified!");
  1232. X              HShock_resistance |= INTRINSIC;
  1233. X              }
  1234. X!         } else if((ptr->mflags1 & M1_SLEE_RES) && ptr->mlevel > rn2(20)) {
  1235. X          /* Undead monsters never sleep,
  1236. X           * but also do not confer resistance when eaten
  1237. X           */
  1238. X--- 538,549 ----
  1239. X              You("feel healthy.");
  1240. X              HPoison_resistance |= INTRINSIC;
  1241. X              }
  1242. X!         } else if(resists_elec(ptr) && ptr->mlevel > rn2(15)) {
  1243. X              if (!(HShock_resistance & INTRINSIC)) {
  1244. X              Your("health currently feels amplified!");
  1245. X              HShock_resistance |= INTRINSIC;
  1246. X              }
  1247. X!         } else if((ptr->mflags1 & M1_SLEE_RES) && ptr->mlevel > rn2(15)) {
  1248. X          /* Undead monsters never sleep,
  1249. X           * but also do not confer resistance when eaten
  1250. X           */
  1251. X***************
  1252. X*** 471,477 ****
  1253. X              You("feel wide awake.");
  1254. X              HSleep_resistance |= INTRINSIC;
  1255. X              }
  1256. X!         } else if(resists_disint(ptr) && ptr->mlevel > rn2(20)) {
  1257. X              if (!(HDisint_resistance & INTRINSIC)) {
  1258. X              You("feel very firm.");
  1259. X              HDisint_resistance |= INTRINSIC;
  1260. X--- 551,557 ----
  1261. X              You("feel wide awake.");
  1262. X              HSleep_resistance |= INTRINSIC;
  1263. X              }
  1264. X!         } else if(resists_disint(ptr) && ptr->mlevel > rn2(15)) {
  1265. X              if (!(HDisint_resistance & INTRINSIC)) {
  1266. X              You("feel very firm.");
  1267. X              HDisint_resistance |= INTRINSIC;
  1268. X***************
  1269. X*** 568,573 ****
  1270. X--- 648,659 ----
  1271. X  {
  1272. X      register int tmp;
  1273. X  
  1274. X+ #ifdef POLYSELF
  1275. X+     if (metallivorous(uasmon)) {
  1276. X+         You("bite right into the metal can....");
  1277. X+         tmp = 1;
  1278. X+     } else
  1279. X+ #endif
  1280. X      if (otmp->blessed) {
  1281. X          pline("The tin opens like magic!");
  1282. X          tmp = 1;
  1283. X***************
  1284. X*** 626,634 ****
  1285. X  }
  1286. X  
  1287. X  static int
  1288. X! rottenfood() {        /* called on the "first bite" of rotten food */
  1289. X! 
  1290. X      pline("Blecch!  Rotten food!");
  1291. X      if(!rn2(4)) {
  1292. X          if (Hallucination) You("feel rather trippy.");
  1293. X          else You("feel rather %s.", body_part(LIGHT_HEADED));
  1294. X--- 712,729 ----
  1295. X  }
  1296. X  
  1297. X  static int
  1298. X! #ifdef POLYSELF
  1299. X! rottenfood(obj)
  1300. X! struct obj *obj;
  1301. X! #else
  1302. X! rottenfood()
  1303. X! #endif
  1304. X! {        /* called on the "first bite" of rotten food */
  1305. X! #ifdef POLYSELF
  1306. X!     pline("Blecch!  Rotten %s!", foodword(obj));
  1307. X! #else
  1308. X      pline("Blecch!  Rotten food!");
  1309. X+ #endif
  1310. X      if(!rn2(4)) {
  1311. X          if (Hallucination) You("feel rather trippy.");
  1312. X          else You("feel rather %s.", body_part(LIGHT_HEADED));
  1313. X***************
  1314. X*** 654,660 ****
  1315. X  eatcorpse(otmp)        /* called when a corpse is selected as food */
  1316. X      register struct obj *otmp;
  1317. X  {
  1318. X!     register char *cname = mons[otmp->corpsenm].mname;
  1319. X      register int tp, rotted = 0;
  1320. X  
  1321. X      tp = 0;
  1322. X--- 749,755 ----
  1323. X  eatcorpse(otmp)        /* called when a corpse is selected as food */
  1324. X      register struct obj *otmp;
  1325. X  {
  1326. X!     register const char *cname = mons[otmp->corpsenm].mname;
  1327. X      register int tp, rotted = 0;
  1328. X  
  1329. X      tp = 0;
  1330. X***************
  1331. X*** 680,686 ****
  1332. X  #endif
  1333. X              make_sick(10L + rn2(10),FALSE);
  1334. X              Sprintf(corpsename, "rotted %s corpse", cname);
  1335. X!             u.usick_cause = corpsename;
  1336. X              flags.botl = 1;
  1337. X  #ifdef POLYSELF
  1338. X          }
  1339. X--- 775,781 ----
  1340. X  #endif
  1341. X              make_sick(10L + rn2(10),FALSE);
  1342. X              Sprintf(corpsename, "rotted %s corpse", cname);
  1343. X!             u.usick_cause = (const char *)corpsename;
  1344. X              flags.botl = 1;
  1345. X  #ifdef POLYSELF
  1346. X          }
  1347. X***************
  1348. X*** 688,699 ****
  1349. X          if (carried(otmp)) useup(otmp);
  1350. X          else useupf(otmp);
  1351. X          return(1);
  1352. X!     } else if(poisonous(&mons[otmp->corpsenm]) && rn2(5)){
  1353. X          tp++;
  1354. X          pline("Ecch - that must have been poisonous!");
  1355. X          if(!Poison_resistance) {
  1356. X              losestr(rnd(4));
  1357. X!             losehp(rnd(15), "poisonous corpse");
  1358. X          } else    You("seem unaffected by the poison.");
  1359. X      /* now any corpse left too long will make you mildly ill */
  1360. X      } else if(((rotted > 5) || ((rotted > 3) && rn2(5)))
  1361. X--- 783,802 ----
  1362. X          if (carried(otmp)) useup(otmp);
  1363. X          else useupf(otmp);
  1364. X          return(1);
  1365. X!     } else if(acidic(&mons[otmp->corpsenm])
  1366. X! #ifdef POLYSELF
  1367. X!           && !resists_acid(uasmon)
  1368. X! #endif
  1369. X!          ) {
  1370. X!         tp++;
  1371. X!         You("have a very bad case of stomach acid.");
  1372. X!         losehp(rnd(15), "acidic corpse", KILLED_BY_AN);
  1373. X!     } else if(poisonous(&mons[otmp->corpsenm]) && rn2(5)) {
  1374. X          tp++;
  1375. X          pline("Ecch - that must have been poisonous!");
  1376. X          if(!Poison_resistance) {
  1377. X              losestr(rnd(4));
  1378. X!             losehp(rnd(15), "poisonous corpse", KILLED_BY_AN);
  1379. X          } else    You("seem unaffected by the poison.");
  1380. X      /* now any corpse left too long will make you mildly ill */
  1381. X      } else if(((rotted > 5) || ((rotted > 3) && rn2(5)))
  1382. X***************
  1383. X*** 703,713 ****
  1384. X                              ){
  1385. X          tp++;
  1386. X          You("feel%s sick.", (Sick) ? " very" : "");
  1387. X!         losehp(rnd(8), "cadaver");
  1388. X      }
  1389. X      if(!tp && otmp->corpsenm != PM_LIZARD && (otmp->orotten || !rn2(7))) {
  1390. X! 
  1391. X          if(rottenfood()) {
  1392. X          otmp->orotten = TRUE;
  1393. X          (void)touchfood(otmp);
  1394. X          return(1);
  1395. X--- 806,819 ----
  1396. X                              ){
  1397. X          tp++;
  1398. X          You("feel%s sick.", (Sick) ? " very" : "");
  1399. X!         losehp(rnd(8), "cadaver", KILLED_BY_AN);
  1400. X      }
  1401. X      if(!tp && otmp->corpsenm != PM_LIZARD && (otmp->orotten || !rn2(7))) {
  1402. X! #ifdef POLYSELF
  1403. X!         if(rottenfood(otmp)) {
  1404. X! #else
  1405. X          if(rottenfood()) {
  1406. X+ #endif
  1407. X          otmp->orotten = TRUE;
  1408. X          (void)touchfood(otmp);
  1409. X          return(1);
  1410. X***************
  1411. X*** 715,724 ****
  1412. X          otmp->oeaten >>= 2;
  1413. X      } else {
  1414. X  #ifdef POLYSELF
  1415. X!         pline("That %s corpse %s!", cname,
  1416. X!         carnivorous(uasmon) ? "was delicious" : "tasted terrible");
  1417. X  #else
  1418. X!         pline("That %s corpse tasted terrible!", cname);
  1419. X  #endif
  1420. X      }
  1421. X  
  1422. X--- 821,830 ----
  1423. X          otmp->oeaten >>= 2;
  1424. X      } else {
  1425. X  #ifdef POLYSELF
  1426. X!         pline("This %s corpse %s!", cname,
  1427. X!         carnivorous(uasmon) ? "is delicious" : "tastes terrible");
  1428. X  #else
  1429. X!         pline("This %s corpse tastes terrible!", cname);
  1430. X  #endif
  1431. X      }
  1432. X  
  1433. X***************
  1434. X*** 739,750 ****
  1435. X      debug("oeaten = %d", otmp->oeaten);
  1436. X  #endif
  1437. X      victual.fullwarn = victual.doreset = FALSE;
  1438. X-     victual.canchoke = (u.uhs == SATIATED);
  1439. X      victual.eating = TRUE;
  1440. X  
  1441. X      if (otmp->otyp == CORPSE)
  1442. X          cprefx(victual.piece->corpsenm);
  1443. X  
  1444. X      Sprintf(msgbuf, "eating the %s", singular(otmp, xname));
  1445. X      set_occupation(eatfood, msgbuf, 0);
  1446. X  }
  1447. X--- 845,862 ----
  1448. X      debug("oeaten = %d", otmp->oeaten);
  1449. X  #endif
  1450. X      victual.fullwarn = victual.doreset = FALSE;
  1451. X      victual.eating = TRUE;
  1452. X  
  1453. X      if (otmp->otyp == CORPSE)
  1454. X          cprefx(victual.piece->corpsenm);
  1455. X  
  1456. X+     if (bite()) return;
  1457. X+ 
  1458. X+     if(++victual.usedtime >= victual.reqtime) {
  1459. X+         done_eating(FALSE);
  1460. X+         return;
  1461. X+     }
  1462. X+ 
  1463. X      Sprintf(msgbuf, "eating the %s", singular(otmp, xname));
  1464. X      set_occupation(eatfood, msgbuf, 0);
  1465. X  }
  1466. X***************
  1467. X*** 829,834 ****
  1468. X--- 941,992 ----
  1469. X      }
  1470. X  }
  1471. X  
  1472. X+ #ifdef POLYSELF
  1473. X+ static void
  1474. X+ eatspecial() /* called after eating non-food */
  1475. X+ {
  1476. X+     register struct obj *otmp = victual.piece;
  1477. X+ 
  1478. X+     lesshungry(victual.nmod);
  1479. X+     victual.piece = (struct obj *)0;
  1480. X+     victual.eating = 0;
  1481. X+     if (otmp->olet == GOLD_SYM) { /* temporary gold object */
  1482. X+         free ((genericptr_t)otmp);
  1483. X+         return;
  1484. X+     }
  1485. X+     if (otmp->olet == POTION_SYM) {
  1486. X+         otmp->quan++; /* dopotion() does a useup() */
  1487. X+         (void)dopotion(otmp);
  1488. X+     }
  1489. X+     if (otmp == uball) unpunish();
  1490. X+     if (otmp == uchain) unpunish(); /* but no useup() */
  1491. X+     else if (carried(otmp)) useup(otmp);
  1492. X+     else useupf(otmp);
  1493. X+ }
  1494. X+ 
  1495. X+ static const char *
  1496. X+ foodword(otmp)
  1497. X+ register struct obj *otmp;
  1498. X+ {
  1499. X+     if (otmp->olet == FOOD_SYM) return "food";
  1500. X+     if (otmp->olet == GOLD_SYM) return "gold";
  1501. X+     if (objects[otmp->otyp].oc_material == GLASS) {
  1502. X+         if (otmp->olet == GEM_SYM && otmp->dknown)
  1503. X+             makeknown(otmp->otyp);
  1504. X+         return "glass";
  1505. X+     }
  1506. X+     if (objects[otmp->otyp].oc_material > WOOD &&
  1507. X+             objects[otmp->otyp].oc_material < MINERAL)
  1508. X+         return "metal";
  1509. X+     if (objects[otmp->otyp].oc_material == MINERAL)
  1510. X+         return (otmp->otyp <= LAST_GEM && otmp->olet == GEM_SYM)
  1511. X+             ? "rich food" : "stone";
  1512. X+     if (objects[otmp->otyp].oc_material == WOOD) return "wood";
  1513. X+     if (otmp->olet == ARMOR_SYM) return "armor";
  1514. X+     return "stuff";
  1515. X+ }
  1516. X+ #endif
  1517. X+ 
  1518. X  static void
  1519. X  fpostfx(otmp)        /* called after consuming (non-corpse) food */
  1520. X  
  1521. X***************
  1522. X*** 859,865 ****
  1523. X              if(!rn2(17)) u.uhpmax++;
  1524. X              u.uhp = u.uhpmax;
  1525. X          } else if(u.uhp <= 0) {
  1526. X!             killer = "rotten jelly lump";
  1527. X              done(POISONING);
  1528. X          }
  1529. X          if(!otmp->cursed) heal_legs();
  1530. X--- 1017,1024 ----
  1531. X              if(!rn2(17)) u.uhpmax++;
  1532. X              u.uhp = u.uhpmax;
  1533. X          } else if(u.uhp <= 0) {
  1534. X!             killer_format = KILLED_BY_AN;
  1535. X!             killer = "rotten lump of royal jelly";
  1536. X              done(POISONING);
  1537. X          }
  1538. X          if(!otmp->cursed) heal_legs();
  1539. X***************
  1540. X*** 870,875 ****
  1541. X--- 1029,1035 ----
  1542. X              if(!resists_ston(uasmon)) {
  1543. X  #endif
  1544. X              if (!Stoned) Stoned = 5;
  1545. X+             killer_format = KILLED_BY_AN;
  1546. X              killer = "cockatrice egg";
  1547. X  #ifdef POLYSELF
  1548. X              }
  1549. X***************
  1550. X*** 885,898 ****
  1551. X      register struct obj *otmp;
  1552. X      int basenutrit;         /* nutrition of full item */
  1553. X  
  1554. X      if (!(otmp = floorfood("eat", 0))) return 0;
  1555. X  
  1556. X      if(otmp == victual.piece) {
  1557. X!         You("resume your meal.");
  1558. X          if(!carried(victual.piece)) {
  1559. X          if(victual.piece->quan != 1)
  1560. X              (void) splitobj(victual.piece, 1);
  1561. X          }
  1562. X          start_eating(victual.piece);
  1563. X          return(1);
  1564. X      }
  1565. X--- 1045,1112 ----
  1566. X      register struct obj *otmp;
  1567. X      int basenutrit;         /* nutrition of full item */
  1568. X  
  1569. X+     if (Strangled) {
  1570. X+         pline("If you can't breathe air, how can you consume solids?");
  1571. X+         return 0;
  1572. X+     }
  1573. X      if (!(otmp = floorfood("eat", 0))) return 0;
  1574. X+ #ifdef POLYSELF
  1575. X+     /* We have to make non-foods take no time to eat, unless we want to
  1576. X+      * do ridiculous amounts of coding to deal with partly eaten plate
  1577. X+      * mails, players who polymorph back to human in the middle of their
  1578. X+      * metallic meal, etc....
  1579. X+      */
  1580. X+     if (!is_edible(otmp)) {
  1581. X+         You("cannot eat that!");
  1582. X+         if (otmp->olet == GOLD_SYM) { /* temp gold object */
  1583. X+         if (otmp->ox) mkgold(OGOLD(otmp), u.ux, u.uy);
  1584. X+         else u.ugold += OGOLD(otmp);
  1585. X+         free((genericptr_t) otmp);
  1586. X+         }
  1587. X+         return 0;
  1588. X+     }
  1589. X+     if (otmp->olet != FOOD_SYM) {
  1590. X+         victual.reqtime = 1;
  1591. X+         victual.piece = otmp;
  1592. X+         /* Don't split it, we don't need to if it's 1 move */
  1593. X+         victual.usedtime = 0;
  1594. X+         victual.canchoke = (u.uhs == SATIATED);
  1595. X+         if (otmp->olet == GOLD_SYM)
  1596. X+         basenutrit = ((OGOLD(otmp) > 5000L) ? 5000 : (int)OGOLD(otmp));
  1597. X+         else basenutrit = otmp->owt * 10 / otmp->quan;
  1598. X+         victual.nmod = basenutrit;
  1599. X+         victual.eating = TRUE; /* needed for lesshungry() */
  1600. X+         
  1601. X+         if (otmp->cursed) 
  1602. X+         (void) rottenfood(otmp);
  1603. X+ 
  1604. X+         if (otmp->olet == WEAPON_SYM && otmp->opoisoned) {
  1605. X+         pline("Ecch - that must have been poisonous!");
  1606. X+         if(!Poison_resistance) {
  1607. X+             losestr(rnd(4));
  1608. X+             losehp(rnd(15), xname(otmp), KILLED_BY_AN);
  1609. X+         } else
  1610. X+             You("seem unaffected by the poison.");
  1611. X+         } else if (!otmp->cursed)
  1612. X+         pline("This %s is delicious!",
  1613. X+             otmp->olet == GOLD_SYM ? "gold" : xname(otmp));
  1614. X+         eatspecial();
  1615. X+         return 1;
  1616. X+     }
  1617. X+ #endif
  1618. X  
  1619. X      if(otmp == victual.piece) {
  1620. X!     /* If they weren't able to choke, they don't suddenly become able to
  1621. X!      * choke just because they were interrupted.  On the other hand, if
  1622. X!      * they were able to choke before, if they lost food it's possible
  1623. X!      * they shouldn't be able to choke now.
  1624. X!      */
  1625. X!         if (u.uhs != SATIATED) victual.canchoke = FALSE;
  1626. X          if(!carried(victual.piece)) {
  1627. X          if(victual.piece->quan != 1)
  1628. X              (void) splitobj(victual.piece, 1);
  1629. X          }
  1630. X+         You("resume your meal.");
  1631. X          start_eating(victual.piece);
  1632. X          return(1);
  1633. X      }
  1634. X***************
  1635. X*** 919,932 ****
  1636. X          victual.reqtime = objects[otmp->otyp].oc_delay;
  1637. X          if (otmp->otyp != FORTUNE_COOKIE &&
  1638. X          (otmp->cursed ||
  1639. X!          ((monstermoves - otmp->age) > otmp->blessed ? 50 : 30)) &&
  1640. X!         (otmp->orotten || !rn2(7))) {
  1641. X  
  1642. X!         if(rottenfood()) {
  1643. X              otmp->orotten = TRUE;
  1644. X              return(1);
  1645. X          }
  1646. X!         otmp->oeaten /= 2;
  1647. X          } else fprefx(otmp);
  1648. X      }
  1649. X  
  1650. X--- 1133,1150 ----
  1651. X          victual.reqtime = objects[otmp->otyp].oc_delay;
  1652. X          if (otmp->otyp != FORTUNE_COOKIE &&
  1653. X          (otmp->cursed ||
  1654. X!          (((monstermoves - otmp->age) > otmp->blessed ? 50 : 30) &&
  1655. X!         (otmp->orotten || !rn2(7))))) {
  1656. X  
  1657. X! #ifdef POLYSELF
  1658. X!         if(rottenfood(otmp)) {
  1659. X! #else
  1660. X!           if(rottenfood()) {
  1661. X! #endif
  1662. X              otmp->orotten = TRUE;
  1663. X              return(1);
  1664. X          }
  1665. X!         otmp->oeaten >>= 1;
  1666. X          } else fprefx(otmp);
  1667. X      }
  1668. X  
  1669. X***************
  1670. X*** 956,966 ****
  1671. X--- 1174,1213 ----
  1672. X          victual.nmod = -(otmp->oeaten / victual.reqtime);
  1673. X      else
  1674. X          victual.nmod = victual.reqtime % otmp->oeaten;
  1675. X+     victual.canchoke = (u.uhs == SATIATED);
  1676. X  
  1677. X      start_eating(otmp);
  1678. X      return(1);
  1679. X  }
  1680. X  
  1681. X+ /* Take a single bite from a piece of food, checking for choking and
  1682. X+  * modifying usedtime.  Returns 1 if they choked and survived, 0 otherwise.
  1683. X+  */
  1684. X+ static int
  1685. X+ bite()
  1686. X+ {
  1687. X+     if(victual.canchoke && u.uhunger >= 2000) {
  1688. X+         choke(victual.piece);
  1689. X+         return 1;
  1690. X+     }
  1691. X+     if (victual.doreset) {
  1692. X+         do_reset_eat();
  1693. X+         return 0;
  1694. X+     }
  1695. X+     if(victual.nmod < 0) {
  1696. X+         lesshungry(-victual.nmod);
  1697. X+         victual.piece->oeaten -= -victual.nmod;
  1698. X+     } else if(victual.nmod > 0 && (victual.usedtime % victual.nmod)) {
  1699. X+         lesshungry(1);
  1700. X+         victual.piece->oeaten--;
  1701. X+     }
  1702. X+     recalc_wt();
  1703. X+     return 0;
  1704. X+ }
  1705. X+ 
  1706. X+ #endif /* OVLB */
  1707. X+ #ifdef OVL0
  1708. X+ 
  1709. X  void
  1710. X  gethungry() {        /* as time goes by - called in main.c */
  1711. X      --u.uhunger;
  1712. X***************
  1713. X*** 983,988 ****
  1714. X--- 1230,1237 ----
  1715. X      newuhs(TRUE);
  1716. X  }
  1717. X  
  1718. X+ #endif /* OVL0 */
  1719. X+ #ifdef OVLB
  1720. X  
  1721. X  void
  1722. X  morehungry(num)    /* called after vomiting and after performing feats of magic */
  1723. X***************
  1724. X*** 1002,1011 ****
  1725. X  #endif
  1726. X      u.uhunger += num;
  1727. X      if(u.uhunger >= 2000) {
  1728. X!         if (!victual.eating || victual.canchoke) {
  1729. X!         choke((struct obj *) 0);
  1730. X!         reset_eat(); /* stop eating if they were lifesaved */
  1731. X!         }
  1732. X      } else {
  1733. X          /* Have lesshungry() report when you're nearly full so all eating
  1734. X           * warns when you're about to choke.
  1735. X--- 1251,1263 ----
  1736. X  #endif
  1737. X      u.uhunger += num;
  1738. X      if(u.uhunger >= 2000) {
  1739. X!         if (!victual.eating || victual.canchoke)
  1740. X!         if (victual.eating) {
  1741. X!             choke(victual.piece);
  1742. X!             reset_eat();
  1743. X!         } else
  1744. X!             choke((struct obj *) 0);
  1745. X!             /* no reset_eat(); it was a non-food such as juice */
  1746. X      } else {
  1747. X          /* Have lesshungry() report when you're nearly full so all eating
  1748. X           * warns when you're about to choke.
  1749. X***************
  1750. X*** 1040,1045 ****
  1751. X--- 1292,1322 ----
  1752. X      return 0;
  1753. X  }
  1754. X  
  1755. X+ #endif /* OVLB */
  1756. X+ #ifdef OVL0
  1757. X+ 
  1758. X+ boolean
  1759. X+ is_fainted() {
  1760. X+     return(u.uhs == FAINTED);
  1761. X+ }
  1762. X+ 
  1763. X+ void
  1764. X+ reset_faint() {    /* call when a faint must be prematurely terminated */
  1765. X+     if(is_fainted()) nomul(0);
  1766. X+ }
  1767. X+ 
  1768. X+ void
  1769. X+ sync_hunger() {
  1770. X+ 
  1771. X+     if(is_fainted()) {
  1772. X+ 
  1773. X+         flags.soundok = 0;
  1774. X+         nomul(-10+(u.uhunger/10));
  1775. X+         nomovemsg = "You regain consciousness.";
  1776. X+         afternmv = unfaint;
  1777. X+     }
  1778. X+ }
  1779. X+ 
  1780. X  void
  1781. X  newuhs(incr)        /* compute and comment on your (new?) hunger status */
  1782. X      boolean incr;
  1783. X***************
  1784. X*** 1052,1060 ****
  1785. X          (h > 0) ? WEAK : FAINTING;
  1786. X  
  1787. X      if(newhs == FAINTING) {
  1788. X!         if(u.uhs == FAINTED) newhs = FAINTED;
  1789. X          if(u.uhs <= WEAK || rn2(20-u.uhunger/10) >= 19) {
  1790. X!             if(u.uhs != FAINTED && multi >= 0 /* %% */) {
  1791. X                  You("faint from lack of food.");
  1792. X                  flags.soundok = 0;
  1793. X                  nomul(-10+(u.uhunger/10));
  1794. X--- 1329,1337 ----
  1795. X          (h > 0) ? WEAK : FAINTING;
  1796. X  
  1797. X      if(newhs == FAINTING) {
  1798. X!         if(is_fainted()) newhs = FAINTED;
  1799. X          if(u.uhs <= WEAK || rn2(20-u.uhunger/10) >= 19) {
  1800. X!             if(!is_fainted() && multi >= 0 /* %% */) {
  1801. X                  You("faint from lack of food.");
  1802. X                  flags.soundok = 0;
  1803. X                  nomul(-10+(u.uhunger/10));
  1804. X***************
  1805. X*** 1068,1073 ****
  1806. X--- 1345,1351 ----
  1807. X              flags.botl = 1;
  1808. X              bot();
  1809. X              You("die from starvation.");
  1810. X+             killer_format = KILLED_BY;
  1811. X              killer = "starvation";
  1812. X              done(STARVING);
  1813. X          }
  1814. X***************
  1815. X*** 1104,1109 ****
  1816. X--- 1382,1388 ----
  1817. X          flags.botl = 1;
  1818. X          if(u.uhp < 1) {
  1819. X              You("die from hunger and exhaustion.");
  1820. X+             killer_format = KILLED_BY;
  1821. X              killer = "exhaustion";
  1822. X              done(STARVING);
  1823. X          }
  1824. X***************
  1825. X*** 1110,1129 ****
  1826. X      }
  1827. X  }
  1828. X  
  1829. X  /* Returns an object representing food.  Object may be either on floor or
  1830. X   * in inventory.
  1831. X   */
  1832. X  struct obj *
  1833. X  floorfood(verb,corpseonly)    /* get food from floor or pack */
  1834. X!     char *verb;
  1835. X      boolean corpseonly;
  1836. X  {
  1837. X      register struct obj *otmp;
  1838. X! 
  1839. X      /* Is there some food (probably a heavy corpse) here on the ground? */
  1840. X      if(!Levitation && !u.uswallow) {
  1841. X          for(otmp = level.objects[u.ux][u.uy]; otmp; otmp = otmp->nexthere) {
  1842. X!         if(corpseonly ? otmp->otyp==CORPSE : otmp->olet==FOOD_SYM) {
  1843. X              pline("There %s %s here; %s %s? ",
  1844. X                  (otmp->quan == 1) ? "is" : "are",
  1845. X                  doname(otmp), verb,
  1846. X--- 1389,1435 ----
  1847. X      }
  1848. X  }
  1849. X  
  1850. X+ #endif /* OVL0 */
  1851. X+ #ifdef OVLB
  1852. X+ 
  1853. X  /* Returns an object representing food.  Object may be either on floor or
  1854. X   * in inventory.
  1855. X   */
  1856. X  struct obj *
  1857. X  floorfood(verb,corpseonly)    /* get food from floor or pack */
  1858. X!     const char *verb;
  1859. X      boolean corpseonly;
  1860. X  {
  1861. X      register struct obj *otmp;
  1862. X! #ifdef POLYSELF
  1863. X!     struct gold *gold = g_at(u.ux, u.uy);
  1864. X!     boolean feeding = (!strcmp(verb, "eat"));
  1865. X! #endif
  1866. X! #ifdef POLYSELF
  1867. X!     if (feeding && gold && metallivorous(uasmon)) {
  1868. X!         if (gold->amount == 1)
  1869. X!         pline("There is 1 gold piece here; eat it? ");
  1870. X!         else pline("There are %ld gold pieces here; eat them? ",
  1871. X!                                 gold->amount);
  1872. X!         if (yn() == 'y') {
  1873. X!         otmp = newobj(0);
  1874. X!         otmp->olet = GOLD_SYM;
  1875. X!         otmp->ox = u.ux;
  1876. X!         otmp->oy = u.uy;
  1877. X!         OGOLD(otmp) = gold->amount;
  1878. X!         freegold(gold);
  1879. X!         return otmp;
  1880. X!         }
  1881. X!     }
  1882. X! #endif
  1883. X      /* Is there some food (probably a heavy corpse) here on the ground? */
  1884. X      if(!Levitation && !u.uswallow) {
  1885. X          for(otmp = level.objects[u.ux][u.uy]; otmp; otmp = otmp->nexthere) {
  1886. X!         if(corpseonly ? otmp->otyp==CORPSE : 
  1887. X! #ifdef POLYSELF
  1888. X!             feeding ? is_edible(otmp) :
  1889. X! #endif
  1890. X!                         otmp->olet==FOOD_SYM) {
  1891. X              pline("There %s %s here; %s %s? ",
  1892. X                  (otmp->quan == 1) ? "is" : "are",
  1893. X                  doname(otmp), verb,
  1894. X***************
  1895. X*** 1133,1139 ****
  1896. X--- 1439,1453 ----
  1897. X          }
  1898. X          }
  1899. X      }
  1900. X+ #ifdef POLYSELF
  1901. X+     /* We cannot use "#" since that causes getobj() to skip its
  1902. X+      * "ugly checks" and we need to check for inedible items.
  1903. X+      */
  1904. X+     return getobj (feeding ? (const char *)everything :
  1905. X+                  (const char *)comestibles, verb);
  1906. X+ #else
  1907. X      return getobj(comestibles, verb);
  1908. X+ #endif
  1909. X  }
  1910. X  
  1911. X  /* Side effects of vomiting */
  1912. X***************
  1913. X*** 1152,1158 ****
  1914. X  {
  1915. X      base *= obj->oeaten;
  1916. X  
  1917. X!     if (obj->otyp == CORPSE) base /= mons[obj->corpsenm].cnutrit;
  1918. X!     else base /= objects[obj->otyp].nutrition;
  1919. X      return (base < 1) ? 1 : base;
  1920. X  }
  1921. X--- 1466,1477 ----
  1922. X  {
  1923. X      base *= obj->oeaten;
  1924. X  
  1925. X!     if (obj->otyp == CORPSE) 
  1926. X!         base = mons[obj->corpsenm].cnutrit ?
  1927. X!                 base / mons[obj->corpsenm].cnutrit : 0;
  1928. X!     else base = objects[obj->otyp].nutrition ?
  1929. X!                 base / objects[obj->otyp].nutrition : 0;
  1930. X      return (base < 1) ? 1 : base;
  1931. X  }
  1932. X+ 
  1933. X+ #endif /* OVLB */
  1934. X*** src/Old/getline.c    Mon Feb 19 18:04:54 1990
  1935. X--- src/getline.c    Mon Feb 19 14:45:59 1990
  1936. X***************
  1937. X*** 12,22 ****
  1938. X--- 12,30 ----
  1939. X  #if defined(SYSV) || defined(DGUX)
  1940. X  #define    NR_OF_EOFS    20
  1941. X  #endif
  1942. X+ #ifdef MACOS
  1943. X+ extern short macflags;
  1944. X+ #endif
  1945. X+ #ifdef OVL1
  1946. X  
  1947. X  char morc = 0;    /* tell the outside world what char he used */
  1948. X  
  1949. X+ #endif /* OVL1 */
  1950. X+ 
  1951. X  extern char erase_char, kill_char;    /* from appropriate tty.c file */
  1952. X  
  1953. X+ #ifdef OVL1
  1954. X+ 
  1955. X  /*
  1956. X   * Read a line closed with '\n' into the array char bufp[BUFSZ].
  1957. X   * (The '\n' is not stored. The string is closed with a '\0'.)
  1958. X***************
  1959. X*** 29,45 ****
  1960. X  {
  1961. X      register char *obufp = bufp;
  1962. X      register int c;
  1963. X! 
  1964. X      flags.toplin = 2;        /* nonempty, no --More-- required */
  1965. X      for(;;) {
  1966. X          (void) fflush(stdout);
  1967. X          if((c = Getchar()) == EOF) {
  1968. X              *bufp = 0;
  1969. X              return;
  1970. X          }
  1971. X          if(c == '\033') {
  1972. X              *obufp = c;
  1973. X              obufp[1] = 0;
  1974. X              return;
  1975. X          }
  1976. X          if(c == erase_char || c == '\b') {
  1977. X--- 37,64 ----
  1978. X  {
  1979. X      register char *obufp = bufp;
  1980. X      register int c;
  1981. X! #ifdef MACOS
  1982. X!     short    tmpflags;
  1983. X!     
  1984. X!     tmpflags = macflags;
  1985. X!     macflags &= ~fDoNonKeyEvt;
  1986. X! #endif
  1987. X      flags.toplin = 2;        /* nonempty, no --More-- required */
  1988. X      for(;;) {
  1989. X          (void) fflush(stdout);
  1990. X          if((c = Getchar()) == EOF) {
  1991. X              *bufp = 0;
  1992. X+ #ifdef MACOS
  1993. X+     macflags |= (tmpflags & fDoNonKeyEvt);
  1994. X+ #endif
  1995. X              return;
  1996. X          }
  1997. X          if(c == '\033') {
  1998. X              *obufp = c;
  1999. X              obufp[1] = 0;
  2000. X+ #ifdef MACOS
  2001. X+     macflags |= (tmpflags & fDoNonKeyEvt);
  2002. X+ #endif
  2003. X              return;
  2004. X          }
  2005. X          if(c == erase_char || c == '\b') {
  2006. X***************
  2007. X*** 49,54 ****
  2008. X--- 68,76 ----
  2009. X              } else    bell();
  2010. X          } else if(c == '\n') {
  2011. X              *bufp = 0;
  2012. X+ #ifdef MACOS
  2013. X+     macflags |= (tmpflags & fDoNonKeyEvt);
  2014. X+ #endif
  2015. X              return;
  2016. X          } else if(' ' <= c && c < '\177' && 
  2017. X                  (bufp-obufp < BUFSZ-1 || bufp-obufp < COLNO)) {
  2018. X***************
  2019. X*** 70,77 ****
  2020. X--- 92,105 ----
  2021. X          } else
  2022. X              bell();
  2023. X      }
  2024. X+ #ifdef MACOS
  2025. X+     macflags |= (tmpflags & fDoNonKeyEvt);
  2026. X+ #endif
  2027. X  }
  2028. X  
  2029. X+ #endif /* OVL1 */
  2030. X+ #ifdef OVLB
  2031. X+ 
  2032. X  void
  2033. X  getret() {
  2034. X      cgetret("");
  2035. X***************
  2036. X*** 79,85 ****
  2037. X  
  2038. X  void
  2039. X  cgetret(s)
  2040. X! register char *s;
  2041. X  {
  2042. X      putsym('\n');
  2043. X      if(flags.standout)
  2044. X--- 107,113 ----
  2045. X  
  2046. X  void
  2047. X  cgetret(s)
  2048. X! register const char *s;
  2049. X  {
  2050. X      putsym('\n');
  2051. X      if(flags.standout)
  2052. X***************
  2053. X*** 92,118 ****
  2054. X      xwaitforspace(s);
  2055. X  }
  2056. X  
  2057. X  
  2058. X  void
  2059. X  xwaitforspace(s)
  2060. X! register char *s;    /* chars allowed besides space or return */
  2061. X  {
  2062. X      register int c;
  2063. X  
  2064. X      morc = 0;
  2065. X  
  2066. X      while((c = readchar()) != '\n') {
  2067. X          if(flags.cbreak) {
  2068. X!         if(c == ' ') break;
  2069. X!         if(s && index(s,c)) {
  2070. X!             morc = c;
  2071. X!             break;
  2072. X!         }
  2073. X!         bell();
  2074. X          }
  2075. X      }
  2076. X  }
  2077. X  
  2078. X  static int last_multi;
  2079. X  
  2080. X  char *
  2081. X--- 120,161 ----
  2082. X      xwaitforspace(s);
  2083. X  }
  2084. X  
  2085. X+ #endif /* OVLB */
  2086. X+ #ifdef OVL1
  2087. X  
  2088. X  void
  2089. X  xwaitforspace(s)
  2090. X! register const char *s;    /* chars allowed besides space or return */
  2091. X  {
  2092. X      register int c;
  2093. X  
  2094. X      morc = 0;
  2095. X+ #ifdef MACOS
  2096. X+     flags.wantspace = TRUE;
  2097. X+ #endif
  2098. X  
  2099. X      while((c = readchar()) != '\n') {
  2100. X+ #ifdef MACOS
  2101. X+         if(c == '\r' || c == 0x3 || c == 'p') break;
  2102. X+ #endif
  2103. X          if(flags.cbreak) {
  2104. X!             if(c == ' ') break;
  2105. X!             if(s && index(s,c)) {
  2106. X!                 morc = c;
  2107. X!                 break;
  2108. X!             }
  2109. X!             bell();
  2110. X          }
  2111. X      }
  2112. X+ 
  2113. X+ #ifdef MACOS
  2114. X+     flags.wantspace = FALSE;
  2115. X+ #endif
  2116. X  }
  2117. X  
  2118. X+ #endif /* OVL1 */
  2119. X+ #ifdef OVL0
  2120. X+ 
  2121. X  static int last_multi;
  2122. X  
  2123. X  char *
  2124. X***************
  2125. X*** 131,156 ****
  2126. X      curs_on_u();
  2127. X  
  2128. X      if (!flags.num_pad || (foo = readchar()) == 'n')
  2129. X!         while((foo = readchar()) >= '0' && foo <= '9') {
  2130. X!         multi = 10*multi+foo-'0';
  2131. X!         if (multi < 0 || multi > LARGEST_INT)
  2132. X!             multi = LARGEST_INT;
  2133. X!         if (multi > 9) {
  2134. X!             remember_topl();
  2135. X!             home();
  2136. X!             cl_end();
  2137. X!             Printf("Count: %d", multi);
  2138. X!         }
  2139. X!         last_multi = multi;
  2140. X!         if(!cnt && foo == '0') prezero = TRUE;
  2141. X!         cnt++;
  2142. X!         }
  2143. X!         if (foo == '\033') {   /* esc cancels count (TH) */
  2144. X!         remember_topl();
  2145. X!         home();
  2146. X!         cl_end();
  2147. X!         multi = last_multi = 0;
  2148. X!         }
  2149. X  # ifdef REDO
  2150. X      if (foo == DOAGAIN || in_doagain)
  2151. X          multi = last_multi;
  2152. X--- 174,202 ----
  2153. X      curs_on_u();
  2154. X  
  2155. X      if (!flags.num_pad || (foo = readchar()) == 'n')
  2156. X!         do {
  2157. X!             foo = readchar();
  2158. X!             if(foo >= '0' && foo <= '9') {
  2159. X!                 multi = 10*multi+foo-'0';
  2160. X!                 if (multi < 0 || multi > LARGEST_INT)
  2161. X!                     multi = LARGEST_INT;
  2162. X!                 if (multi > 9) {
  2163. X!                     remember_topl();
  2164. X!                     home();
  2165. X!                     cl_end();
  2166. X!                     Printf("Count: %d", multi);
  2167. X!                 }
  2168. X!                 last_multi = multi;
  2169. X!                 if(!cnt && foo == '0') prezero = TRUE;
  2170. X!                 cnt++;
  2171. X!             }
  2172. X!             if (foo == '\033') {   /* esc cancels count (TH) */
  2173. X!                 remember_topl();
  2174. X!                 home();
  2175. X!                 cl_end();
  2176. X!                 multi = last_multi = 0;
  2177. X!             }
  2178. X!         } while(foo >= '0' && foo <= '9');
  2179. X  # ifdef REDO
  2180. X      if (foo == DOAGAIN || in_doagain)
  2181. X          multi = last_multi;
  2182. X***************
  2183. X*** 184,189 ****
  2184. X--- 230,238 ----
  2185. X      return(in_line);
  2186. X  }
  2187. X  
  2188. X+ #endif /* OVL0 */
  2189. X+ #ifdef OVLB
  2190. X+ 
  2191. X  #ifdef UNIX
  2192. X  static void
  2193. X  end_of_input()
  2194. X***************
  2195. X*** 194,199 ****
  2196. X--- 243,251 ----
  2197. X  }
  2198. X  #endif
  2199. X  
  2200. X+ #endif /* OVLB */
  2201. X+ #ifdef OVL0
  2202. X+ 
  2203. X  char
  2204. X  readchar() {
  2205. X      register int sym;
  2206. X***************
  2207. X*** 226,231 ****
  2208. X--- 278,286 ----
  2209. X      return((char) sym);
  2210. X  }
  2211. X  
  2212. X+ #endif /* OVL0 */
  2213. X+ #ifdef OVL2
  2214. X+ 
  2215. X  #ifdef COM_COMPL
  2216. X  /* Read in an extended command - doing command line completion for
  2217. X   * when enough characters have been entered to make a unique command.
  2218. X***************
  2219. X*** 303,305 ****
  2220. X--- 358,362 ----
  2221. X  
  2222. X  }
  2223. X  #endif /* COM_COMPL */
  2224. X+ 
  2225. X+ #endif /* OVL2 */
  2226. X
  2227. END_OF_FILE
  2228. if test 56128 -ne `wc -c <'patch7.03'`; then
  2229.     echo shar: \"'patch7.03'\" unpacked with wrong size!
  2230. fi
  2231. # end of 'patch7.03'
  2232. echo shar: End of archive 7 \(of 30\).
  2233. cp /dev/null ark7isdone
  2234. MISSING=""
  2235. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 ; do
  2236.     if test ! -f ark${I}isdone ; then
  2237.     MISSING="${MISSING} ${I}"
  2238.     fi
  2239. done
  2240. if test "${MISSING}" = "" ; then
  2241.     echo You have unpacked all 30 archives.
  2242.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2243. else
  2244.     echo You still need to unpack the following archives:
  2245.     echo "        " ${MISSING}
  2246. fi
  2247. ##  End of shell archive.
  2248. exit 0
  2249.